package com.baizhi.feign;

import com.baizhi.common.dto.Product;
import com.baizhi.common.vo.PageVO;
import com.baizhi.common.vo.R;
import com.baizhi.feign.fallback.ProductFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @Author wy
 * @Description 远程调用productservice服务feign注解
 * @Date 2023/6/28 9:04
 * @Version 1.0
 */
@FeignClient(value = "PRODUCTSERVICE",fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {

    /**
     * 远程调用产品服务的feign客户端
     * @param page
     * @param rows
     * @param categoryId
     * @return
     */
    @GetMapping(value = "/productList2")
    R<PageVO<Product>> productSearch(@RequestParam(value = "page") Integer page,
                                               @RequestParam(value = "rows") Integer rows,
                                               @RequestParam(value = "categoryId") Integer categoryId);


}
